/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 涛
 * Date: 2023-09-05
 * Time: 23:16
 */
import java.util.Map;
import java.util.Random;
import java.util.Scanner;
public class test {
    public static void main(String[] args) {
        Random random = new Random();//默认种子是系统时间
        Scanner sc = new Scanner(System.in);
        int toGuess = random.nextInt(100);//0~100
        System.out.println("toGuess:"+toGuess);
        while(true) {
            System.out.println("请输入您要猜的数字:(0~100)");
            int num = sc.nextInt();
            if(toGuess < num) {
                System.out.println("大了");
            }else if(toGuess > num) {
                System.out.println("小了");
            }else {
                System.out.println("猜对了");
                break;
            }
        }
    sc.close();
    }
}
